//********************************************************************************************************
// Product Name: MapWindow.dll Alpha
// Description:  The basic module for MapWindow version 6.0
//********************************************************************************************************
// The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); 
// you may not use this file except in compliance with the License. You may obtain a copy of the License at 
// http://www.mozilla.org/MPL/ 
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 
// ANY KIND, either expressed or implied. See the License for the specificlanguage governing rights and 
// limitations under the License. 
//
// The Original Code is from MapWindow.dll version 6.0
//
// The Initial Developer of this Original Code is Ted Dunsford. Created 6/9/2008 12:10:53 PM
// 
// Contributor(s): (Open source contributors should list themselves and their modifications here). 
//
//********************************************************************************************************

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;

using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;

namespace MapWindow.DirectX
{


    /// <summary>
    /// Drawing Components don't actually do the drawing.  Instead, they store
    /// buffers and configuration settings that need to do something to the
    /// device before and after the actual drawing takes place.  This includes
    /// Index buffers, Vertex buffers, textures and effects.
    /// </summary>
    public interface IDrawingComponent
    {

        #region Events

        /// <summary>
        /// Occurs after the device is initialized during a drawing cycle.
        /// </summary>
        event EventHandler Initialized;

        /// <summary>
        /// Occurs when the Invalidate method is called
        /// </summary>
        event EventHandler Invalidated;

        #endregion

        #region Methods

        /// <summary>
        /// This method should be called after the drawing has taken place.
        /// </summary>
        /// <param name="device"></param>
        void AfterDrawing(Device device);
       

        /// <summary>
        /// This doesn't physically draw the indicies, but simply sets the index buffer.
        /// If the index buffer hasn't yet been initialized, this will take care of that.
        /// </summary>
        /// <param name="device"></param>
        void BeforeDrawing(Device device);

        /// <summary>
        /// Disposes any unmanaged memory objects.  This will not affect the managed
        /// variables.
        /// </summary>
        void Dispose();


        /// <summary>
        /// This invalidates the drawing component so that it has to be re-initialized
        /// during the next drawing cycle
        /// </summary>
        void Invalidate();


      


        #endregion

        #region Properties

        /// <summary>
        /// Gets a boolean value indicating whether or not this drawing component has
        /// been initialized
        /// </summary>
        bool IsInitialized
        {
            get;
        }


        #endregion



    }
}
